define([
    "UtilDir/util",
    "UtilDir/tool",
    "UtilDir/org/selectOrg",
    "UtilDir/searchBlock",
    "static/app/hddc/hddccjcommon/hddccjCommon",
    "Date","DateCN", "css!DateCss",
    "EasyUI","EasyUI-lang"
],function(Util, Tool, SelectOrg, SearchBlock,HddccjCommon){
    //A4_GeophysicalField（地球物理学）
    //获取线路|面经纬度数组
    var getLonLatArray = function(LonLatString){
        var LonLatArray = [];//经纬度数组
        var strArray = LonLatString.split(";");
        if(strArray!=null && strArray.length>0){
            for(var i=0;i<strArray.length;i++){
                var str = strArray[i];
                var lonlatStrArray = str.split(",");
                if(lonlatStrArray!=null && lonlatStrArray.length==2){
                    var lonStr = lonlatStrArray[0];
                    var latStr = lonlatStrArray[1];
                    if(lonStr!="" && latStr!=""){
                        var lon = parseFloat(lonStr);
                        var lat = parseFloat(latStr);
                        if(lon>0 && lon<180 && lat>0 && lat<90){
                            //经纬度
                            var lonlat = [lon,lat];
                            //添加经纬度
                            LonLatArray.push(lonlat);
                        }
                    }
                }
            }
        }
        return LonLatArray;
    };

    //14-1：1万底图岩体线-线
    var getHddcRock1linepreController = function(){
        return getServer() + "/hddc/hddcRock1linepres";
    };
    var initQueryRock1LinePreData = function () {
        console.log("14-1：1万底图岩体线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock1linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //15-1：1万工作底图岩体-面
    var getHddcRock1preController = function(){
        return getServer() + "/hddc/hddcRock1pres";
    };
    var initQueryRock1PreData = function () {
        console.log("15-1：1万工作底图岩体-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock1preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //16-1：25万底图岩体线-线
    var getHddcRock25linepreController = function(){
        return getServer() + "/hddc/hddcRock25linepres";
    };
    var initQueryRock25LinePreData = function () {
        console.log("16-1：25万底图岩体线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock25linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //17-1：25万工作底图岩体-面
    var getHddcRock25preController = function(){
        return getServer() + "/hddc/hddcRock25pres";
    };
    var initQueryRock25PreData = function () {
        console.log("17-1：25万工作底图岩体-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock25preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //18-1：5万底图岩体线-线
    var getHddcRock5linepreController = function(){
        return getServer() + "/hddc/hddcRock5linepres";
    };
    var initQueryRock5LinePreData = function () {
        console.log("18-1：5万底图岩体线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock5linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //19-1：5万工作底图岩体-面
    var getHddcRock5preController = function(){
        return getServer() + "/hddc/hddcRock5pres";
    };
    var initQueryRock5PreData = function () {
        console.log("19-1：5万工作底图岩体-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcRock5preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //20-1：1万底图地层线-线
    var getHddcStratigraphy1linepreController = function(){
        return getServer() + "/hddc/hddcStratigraphy1linepres";
    };
    var initQueryStratigraphy1LinePreData = function () {
        console.log("20-1：1万底图地层线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy1linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //21-1：1万工作底图地层-面
    var getHddcStratigraphy1preController = function(){
        return getServer() + "/hddc/hddcStratigraphy1pres";
    };
    var initQueryStratigraphy1PreData = function () {
        console.log("21-1：1万工作底图地层-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy1preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //22-1：25万底图地层线-线
    var getHddcStratigraphy25linepreController = function(){
        return getServer() + "/hddc/hddcStratigraphy25linepres";
    };
    var initQueryStratigraphy25LinePreData = function () {
        console.log("22-1：25万底图地层线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy25linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //23-1：25万工作底图地层-面
    var getHddcStratigraphy25preController = function(){
        return getServer() + "/hddc/hddcStratigraphy25pres";
    };
    var initQueryStratigraphy25PreData = function () {
        console.log("23-1：25万工作底图地层-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy25preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //24-1：5万底图地层线-线
    var getHddcStratigraphy5linepreController = function(){
        return getServer() + "/hddc/hddcStratigraphy5linepres";
    };
    var initQueryStratigraphy5LinePreData = function () {
        console.log("24-1：5万底图地层线-线");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy5linepreController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    //25-1：5万工作底图地层-面
    var getHddcStratigraphy5preController = function(){
        return getServer() + "/hddc/hddcStratigraphy5pres";
    };
    var initQueryStratigraphy5PreData = function () {
        console.log("25-1：5万工作底图地层-面");
        var allLonLatArray = [];
        var allUuidArray = [];
        var allDataArray=[];
        $.ajax({
            url: getHddcStratigraphy5preController() + "/queryAllSpaceData/",
            type: "get",
            async:true,
            success: function (data) {
                for(var i=0;i<data.length;i++){
                    var LonLatString = data[i].extends5;//经纬度字符串
                    if(LonLatString!=null && LonLatString!=""){
                        var LonLatArray = getLonLatArray(LonLatString);//获取经纬度数组
                        //添加经纬度数组
                        allLonLatArray.push(LonLatArray);
                        //添加UUID
                        allUuidArray.push(data[i].uuid);
                    }
                }
                allDataArray = [allUuidArray,allLonLatArray];
            }
        });
        return allDataArray;
    };

    return {
        initQueryRock1LinePreData:initQueryRock1LinePreData,
        initQueryRock1PreData:initQueryRock1PreData,
        initQueryRock25LinePreData:initQueryRock25LinePreData,
        initQueryRock25PreData:initQueryRock25PreData,
        initQueryRock5LinePreData:initQueryRock5LinePreData,
        initQueryRock5PreData:initQueryRock5PreData,
        initQueryStratigraphy1LinePreData:initQueryStratigraphy1LinePreData,
        initQueryStratigraphy1PreData:initQueryStratigraphy1PreData,
        initQueryStratigraphy25LinePreData:initQueryStratigraphy25LinePreData,
        initQueryStratigraphy25PreData:initQueryStratigraphy25PreData,
        initQueryStratigraphy5LinePreData:initQueryStratigraphy5LinePreData,
        initQueryStratigraphy5PreData:initQueryStratigraphy5PreData
    };
});
